import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.example.mapper.UserMapper;
import org.example.pojo.User;
import org.example.util.SqlSessionFactoryUtils;

public class test {
    public static void main(String[] args) {
        SqlSessionFactory sqlSessionFactory = SqlSessionFactoryUtils.getSqlSessionFactory();
        System.out.println(sqlSessionFactory);
        //2.2获取SQLSession对象
        SqlSession session = sqlSessionFactory.openSession();
        //2.3获取Mapper
        UserMapper mapper = session.getMapper(UserMapper.class);

        //2.4调用方法
        User user = mapper.select("username", "password");

        //2.5释放资源
        session.close();
    }
}
